var app = getApp()
var goto
Page( {
  data: {
    userInfo: {},
    score: 110,  
    login: "会员登录",
    right:"http://housecleanimags-1255598775.cosbj.myqcloud.com/icon/right.png",
    userListInfo: [ {
      icon: '	http://housecleanimags-1255598775.cosbj.myqcloud.com/icon/iconfont-dingdan.png',
        text: '我的订单',
        bindtap:"toMyOrders",   
    },
    //  {
    //     icon: '	http://housecleanimags-1255598775.cosbj.myqcloud.com/icon/iconfont-card.png',
    //     text: '我的卡券',
    //     bindtap: "toMyCoupon",
    //     isunrea: true,
    //     unreadNu: 2,        
    // }, 
    {
        icon: '	http://housecleanimags-1255598775.cosbj.myqcloud.com/icon/iconfont-kefu.png',
        text: '联系客服 0631-67876578', 
        bindtap: "toTel",       
    }, {
        icon: '	http://housecleanimags-1255598775.cosbj.myqcloud.com/icon/gift.png',
        text: '领取优惠券',
        bindtap: "togift",
        flag: true,
    }]
  },
  // 跳转至地址管理页面
  toSelectAddress:function(){
    wx.navigateTo({
      url: '../../public/selectAddress/index',
    })     
  },
  toMyOrders:function(){
    wx.navigateTo({
      url: '../myOrders/index',
    })  
  },
  toMyCoupon:function(){
    // wx.navigateTo({
    //   url: '../myCoupon/index',
    // })
  },
  toTel:function(){
    wx.makePhoneCall({
      phoneNumber:"0631-67876578"
    })
  },
  togift:function(){
    wx.navigateTo({
      url: '../gift/index',
    })
  },
  onLoad: function() {
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo( function( userInfo ) {
      //更新数据
      that.setData( {
        userInfo: userInfo
      })
     }
    )
  }
})